<?php
/**
 * Created by JetBrains PhpStorm.
 * User: alex
 * Date: 19.07.13
 * Time: 9:33
 * To change this template use File | Settings | File Templates.
 */
class Controller_Static extends Controller_Default
{
	private $staticPage = array (
		"pay"       => "pay",
		"delivery"  => "delivery",
		"contacts"  => "contacts",
		"discounts" => "discounts",
		"guarantee" => "guarantee",
	);
	function __construct($url)
	{
		switch($url)
		{
			case $this->staticPage["pay"]:
			case $this->staticPage["delivery"]:
			case $this->staticPage["contacts"]:
			case $this->staticPage["discounts"]:
			case $this->staticPage["guarantee"]:
				$this->getStaticPage($url);
			break;
			default:
			break;
		}
	}

	private function getStaticPage($url)
	{
        $model = new Model_Static();
        $content = $model->getContent($url);

        $view = new View_Static();
        $view->pageContent = $content;
        $this->view = $view->view();

        $this->render("static.twig");
	}

}